﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

using ProjectBase.Core;

namespace $safeprojectname$.Services
{
    public interface IRoleAccess
    {
        /// <summary>
        ///     The name of the existing role (returned from the Roles provider)
        ///     which is currently evaluated.
        /// </summary>
        string RoleName { get; }

        /// <summary>
        ///     The name of the controller to which this instance belongs.
        /// </summary>
        string ControllerName { get; }

        /// <summary>
        ///     The list of Actions which are allowed for this RoleName.
        ///     This list is evaluated only if the UseDenied switch is set to false.
        ///     In such a case any action contained in this list is allowed, else prohibited.
        /// </summary>
        IEnumerable<string> GrantedActions { get; }

        /// <summary>
        ///     The list of prohibited actions for this RoleName.
        ///     If the switch UseDenied is set to true, 
        ///     then every action is allowed unless its name is not contained in this DeniedActions list
        /// </summary>
        IEnumerable<string> DeniedActions { get; }

        /// <summary>
        ///     True means, that whenever the action is not in the DeniedActions list - action is allowed.
        ///     False means, that action is compared with the GrantedActions list - when is not contained, access is prohibited.
        ///     Default value is true (it means, that if the DeniedList is empty, every action is granted)
        /// </summary>
        bool UseDenied { get; }

        /// <summary>
        ///     This switch allowes to remove some nodes or controllers from the Menu TreeView rendering
        ///     even if the user role is granted. useful for Home, CodeLists etc.
        /// </summary>
        bool IsVisible { get; }

        /// <summary>
        ///     Allows bulk decision about prohibiting the access to WriteActions
        /// </summary>
        bool IsReadOnly { get; }
    }
}